const storagePlugin = store => {
  // 订阅每次 mutation 方法的调用
  store.subscribe((mutation, state) => {
    console.log('提交了 mutation:', mutation, state)

    // 将更改后的状态数据保存到本地存储中
    localStorage.setItem('count', JSON.stringify(state.counter.count))
  })
}

export default storagePlugin
